// IA32Interpreter.h
// define class IA32Interpreter
#ifndef IA32INTERPRETER_H
#define IA32INTERPRETER_H

#include <iostream>
#include "crossbit/Interpreter.h"
#include "crossbit/ELFMemoryImage.h"
#include "arch/ia32/IA32ProcessorState.h"

namespace crossbit {
    class IA32Syscall;

    // added by Chuchao, declear the funcs that set the flags, in order to make these declearations visible to other files

    void set_flags_incl(ProcessorState *state, int a);
    void set_flags_incw(ProcessorState *state, int a);
    void set_flags_incb(ProcessorState *state, int a);
    void set_flags_decl(ProcessorState *state,int a,int b);
    void set_flags_decw(ProcessorState *state,int a,int b);
    void set_flags_decb(ProcessorState *state,int a,int b);
    void set_flags_imull2(ProcessorState *state,int a);

    void set_flags_shll(ProcessorState *state,int a,int b);
    void set_flags_shrl(ProcessorState *state,int a,int b);
    void set_flags_sarl(ProcessorState *state,int a,int b);
    void set_flags_shrdl(ProcessorState *state, int dest, int result, int count);

    void set_seg_base(ProcessorState *state,int gs);


    void initializeSyscall(IA32Syscall* syscall);

	union operand
	{
		Word 	imm;
		RegNum	reg;
	};

	struct x86_operand
	{
		union operand op1;
		union operand op2;
		union operand op3;
	};
	
	struct x86_insn;	

   extern Word* _regs; 

    class IA32Interpreter : public Interpreter {
	public:
	    IA32Interpreter(IA32ProcessorState *state, ELFMemoryImage *mm) 
     : Interpreter(state), mm_(mm)
	    {
         state_ = state;
	    }

	    ~IA32Interpreter() 
	    {
	    }

	    XTMemAddr decode(XTMemAddr at, VBlockBuilder *bb);

     /*
	    ProcessorState *sourceCPU() 
	    {
		       return state_;
	    }
     */

	    IA32ProcessorState *getProcessorState() 
	    {
		       return state_;
	    }

	    XTInt32 initStack(XTMemAddr sp)
	    {
		       _regs = (Word*)state_->get(0);

		       state_->put(IA32ProcessorState::ESP, sp);
         
         return 0;
	    }

	private:
		//A general func that called by our insn-decoding funcs to resolve ModR/M
		XTRegNum resolveModRM(x86_insn *insn, x86_operand *op, VBlockBuilder *bb );
		
		//A func that support to deal with insns contained REP prefix(such as movsb)
		//void rep_prefix(x86_insn *insn, x86_operand *op, VBlockBuilder *bb);

	    ELFMemoryImage *mm_; // locate code/data address at memory image
	    IA32ProcessorState *state_;
	    Byte lastCondOp_;
		
	public:
		//decode functions for corresponding x86 instructions
		void rorm_i_adcb80	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void adcl_id		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void adcl_sib		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_cmpxchg	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_xorb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_xorb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_xorl31	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_xorl81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_xorl33	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_xorl83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_xorw31	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_incl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_incb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_incl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_incw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_incw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void Ob_movb_AL		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AL_movb_Ob		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_i_movb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void movsl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void movsw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void stosb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void stosw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void stosd		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_movb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_movb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_int		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void int3		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_pushl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_call		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void cdq		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void cwtl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_call		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movl8b	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_r_movw8e		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_popl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_subl83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_subw83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_subw29	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void EAX_i_subl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_subl29	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_subb28	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_subb80	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_subl2b	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_subw2b	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void ret		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_ret		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void cl_roll		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_roll		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_rorl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_rorw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_andl83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_andl81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_andw81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AL_i_andb24	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_andb20	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_andb80	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_andl21	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_andw21	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_andl23	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_andb22	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_pushl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_pushl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_sbbl83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_sbbl19	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_sbbl1b	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_i_movl  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jbb  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jbd  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jsb  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jsd  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnsb  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnsd  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jmpb  		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jzb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_testl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_testw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_testw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jned		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jlb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jld		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jled		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jleb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void AX_i_cmpw3d	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_r_cmpw39	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_cmpw81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_cmpw83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void r_rorm_cmpw3b	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_cmpl83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_cmpl81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_r_cmpl39	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void r_rorm_cmpl3b	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void cmpsb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_r_xaddl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_addl83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_addw83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_addl81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_r_addl01	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_r_adcl11	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void r_rorm_addl03	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void AL_i_addb04	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void AL_i_subb2c	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_r_addb00	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_addb80	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void r_rorm_addb02	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_r_addw01          (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void r_rorm_addw03	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void EAX_i_addl 	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setz		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setbe		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setnbe	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setnb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setle		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setnl	            (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setnle	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void i_jmpd		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_jmpd		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void r_m_leal		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AX_Ow_movw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void Ow_AX_movw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_movw89	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_movl89	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_subl81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void mo_EAX_movl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jneb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jzd		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_testb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_testb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AL_i_testb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
	 	void EAX_i_testl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_testl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movzbl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movzbw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movzwl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movswl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movsbl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movsbw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_movlc7	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_movwc7	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_movw	      (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_i_movw	      (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnbeb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnbed		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnlb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnld		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnleb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnled		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_setnz		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void EAX_i_orl0d	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_orl09	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_orl83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_orw81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_orw83	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AL_i_orb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_orl81	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_orw 	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_orb 	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_orb0a	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_orb80	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_orl0b	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void EAX_i_cmpl3d	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnbd		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jnbb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AL_i_cmpb3c	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void nop		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_shllc1	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void shlld1		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void shldl_cl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_i_shldl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void shrdl_cl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_CL_sarl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void sarld1 		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void sarw_i1		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_sarlc1	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_sarbc0	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_shlld3	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_shrld3	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_shrld1	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_i_shrlc1	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_shrb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_shlw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void shrb_ib		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void shrw_i1		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void shrw_ib		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
        	void rorm_i_cmpb80	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_cmpb38	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_cmpb3a	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jbeb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void i_jbed		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_notb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_notl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_negl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void EAX_mo_movl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void EAX_rorm_divl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void idivf7		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void imulf7		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_imull	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_imulw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void imull_id		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_i_imull	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		// void r_rorm_i_imulw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void EAX_rorm_mull	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void cld		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void m_m_movsb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void leave		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_rorm_xchgb	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_xchgl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void f_fnstcw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void f_fldcw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void frndint		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fildl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fildq		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void filds		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fimull		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fiaddl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fadd_st0_sti	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fadd_sti_st0	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fadds		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fchs		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void faddl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubrl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubrs		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubs		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void faddp		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsub_st0_sti	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubr_st0_sti	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubr_sti_st0	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsub_sti_st0	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubp_sti_st0	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsubrp_sti_st0	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fisubl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fisubrl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fmul_st0_sti	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fmul_sti_st0	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fmulp		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fmull		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fmuls		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fstp_sti		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fst_sti		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsqrt		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fstl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsts		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fstpl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fstps		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fistl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fistpl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fistps		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fistpll		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fld_sti		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fldl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void flds		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fldz		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fld1		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fnstsw_ax		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fxam		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fucom		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fucomp		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fcompl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fucompp		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fxch_sti		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fidivl	      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdiv_st0_sti      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdiv_sti_st0      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivp_sti_st0     	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivr_sti_st0     	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivr_st0_sti     	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivrs	      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivs	      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fidivrl	      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivrp	      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivrl	      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fdivl	      	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fabs		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fldl2e		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fldlg2		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fldln2		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fyl2x		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fyl2xp1		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void f2xm1		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fscale		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fcos		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fsin       	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void fptan		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void EAX_i_andl25	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AX_i_andw25	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void AX_i_orw	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void m_r_scasb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void r_decl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_decw		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void decw_rx		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_decb		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void m_decl		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_i_shrdl	    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void bsfl 		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void bsrl 		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void sahf 		    (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void pushf_eflags   (x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void popf_eflags	(x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_cmpxchgw		(x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_btsl		(x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
		void rorm_r_btl		(x86_insn *insn, x86_operand *op, VBlockBuilder *bb);

    };
		
	typedef void (IA32Interpreter::*XbitCallbackPtr_t)(x86_insn *insn, x86_operand *op, VBlockBuilder *bb);
	
}
#endif
